package com.culturalCenter.dataCenter.service.impl.user;

import com.culturalCenter.dataCenter.entity.user.UserLocationTypeCount;
import com.culturalCenter.dataCenter.mapper.user.UserLocationTypeCountMapper;
import com.culturalCenter.dataCenter.service.user.UserLocationTypeCountService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/****
 * @Author:
 * @Description:UserLocationTypeCount业务层接口实现类
 * @Date
 *****/
@Service
public class UserLocationTypeCountServiceImpl implements UserLocationTypeCountService {

    @Resource
    private UserLocationTypeCountMapper userLocationTypeCountMapper;

    @Override
    public PageInfo<UserLocationTypeCount> findPage(int page, int size) {
        return PageHelper.startPage(page, size).doSelectPageInfo(() -> userLocationTypeCountMapper.findPageAll());
    }

    @Override
    public Integer delete(String id) {
        return userLocationTypeCountMapper.deleteById(id);
    }

    @Override
    public Integer update(UserLocationTypeCount userLocationTypeCount) {
        return userLocationTypeCountMapper.update(userLocationTypeCount);
    }

    @Override
    public Integer add(UserLocationTypeCount userLocationTypeCount) {
        return userLocationTypeCountMapper.insert(userLocationTypeCount);
    }

    @Override
    public UserLocationTypeCount findById(String id) {
        return userLocationTypeCountMapper.queryById(id);
    }

    @Override
    public List<UserLocationTypeCount> findAll(UserLocationTypeCount userLocationTypeCount) {
        return (List<UserLocationTypeCount>) userLocationTypeCountMapper.queryAll(userLocationTypeCount);
    }

}
